package com.fg.cloud.framework.shiro;

import java.io.IOException;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.web.filter.authc.FormAuthenticationFilter;

public class DefaultAuthenticatingFilter extends FormAuthenticationFilter {

	@Override
	protected boolean executeLogin(ServletRequest request, ServletResponse response) throws Exception {
		// TODO Auto-generated method stub
		AuthenticationToken token = createToken(request, response);
		
		token.getPrincipal();
		
		Subject subject = getSubject(request, response);
		
		
		return super.executeLogin(request, response);
	}
	
	@Override
	public void doFilterInternal(ServletRequest request, ServletResponse response, FilterChain chain)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
		super.doFilterInternal(request, response, chain);
	}
	
	@Override
	protected void issueSuccessRedirect(ServletRequest request, ServletResponse response) throws Exception {
		// TODO Auto-generated method stub
		super.issueSuccessRedirect(request, response);
	}

}
